package com.ruoyi.web.controller.admin;


import com.ruoyi.business.domain.entity.article.Article;
import com.ruoyi.business.service.article.IArticleService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/article")
public class ArticleController extends BaseController {

    @Autowired
    private IArticleService articleService;

    @GetMapping("/list")
    public TableDataInfo list(Article article){
        startPage();
        article.setDelFlag(0); // 0表示正常状态，1表示删除状态
       List<Article> list = articleService.selectArticleList(article);
       return getDataTable(list);
    }

}
